{% extends "header.html" %}

{% block content %}

<div id="addr">
    <p>确认地址信息</p>
    <p><em>寄送至: </em><span name="addr">{{user.addr}} | {{user.name}} | {{user.tel}}</span><em>&nbsp;&nbsp;<默认地址></em></p>
    <!--<p>输入新地址-收货人-电话: <input type="text" class="input-medium" name="newaddr" />-<input type="text" class="span2" name="newname"/>-<input type="text" class="span2" name="newtel"/><button class="btn btn-primary" id="addaddr">更改地址</button></p> -->
</div>

<div id="orderlist">
    <p>确认订单信息</p>
    <table class="table table-hover table-striped" >
         <thead>
            <tr>
                <th>商品名称</th>
                <th>商品描述</th>
                <th>价格</th>
            </tr>
        </thead>
        <tbody>
            {% if item %}
            <tr>
                <td>{{item.name}}</td>
                <td>{{item.descpt}}</td>
                <td>{{item.price}}</td>
            </tr>
            {% endif %}
        </tbody>
    </table>
</div>

<div id="pay">
    <p class="total-price">
    <em>商品总价: </em>
    <span class="price">¥{{order_price}}</span>
    <span class="total"></span>
    </p>
    {% if user %}
    <p class="addr"> 
        <em>寄送地址: </em> 
        <span name="realaddr">{{user.addr}} </span>
    </p>
    <p class="receiver"> 
        <em>收货人:</em> 
        <span>{{user.name}}  {{user.tel}} </span>
    </p>
    {% endif %}
</div>

<div id="btn-div">
    <button class="btn btn-primary btn-large btn-pay" onclick="buy()">提交订单</button>
</div>

<form id="order" action="/buy" method="POST">
        <input type="hidden" name="pid" value={{item.pid}} />
        <input type="hidden" name="price" value={{item.price}} />
        <input type="hidden" name="token" value={{token}} />
</form>

{% endblock %}
